package org.springblade.modules.repair.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.constant.BladeConstant;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springblade.modules.repair.mapper.ElevatorBrandMapper;
import org.springblade.modules.repair.entity.ElevatorBrand;
import org.springblade.modules.repair.service.ElevatorBrandService;

@Service
public class ElevatorBrandServiceImpl extends BaseServiceImpl<ElevatorBrandMapper, ElevatorBrand> implements ElevatorBrandService{

	@Override
	public List<Map<String, Object>> getBrands() {
		List<Map<String, Object>> list = this.list(Wrappers.<ElevatorBrand>lambdaQuery().eq(ElevatorBrand :: getIsDeleted, BladeConstant.DB_NOT_DELETED))
			.stream().map(elevatorBrand -> {
				Map<String, Object> map = new HashMap<>();
				map.put("id", elevatorBrand.getId());
				map.put("brandName", elevatorBrand.getBrandName());
				return map;
			}).collect(Collectors.toList());
		return list;
	}
}
